home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-25 | 1.5 KB | 67 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWFixMem.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWFIXMEM_H
- #define FWFIXMEM_H
-
- #include <stddef.h>
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- //========================================================================================
- // Foreware declarations
- //========================================================================================
-
- struct FW_SPrivFixedNode;
- struct FW_SPrivFixedBlock;
-
- //========================================================================================
- // CLASS FW_CFixedAllocator
- //========================================================================================
-
- class FW_CFixedAllocator
- {
- public:
-
- // ----- Construction
-
- FW_CFixedAllocator(
- short allocSize
- #ifdef FW_DEBUG
- , const char* name = "Unknown"
- #endif
- );
- ~FW_CFixedAllocator();
-
- // ----- Allocation
-
- void* Allocate();
- void Free(void* block);
-
- // ----- Implementation
-
- private:
- long fAllocCount;
- short fAllocSize;
- FW_SPrivFixedNode* fFreeList;
- FW_SPrivFixedBlock* fBlockList;
-
- #ifdef FW_DEBUG
- const char* fDebugName;
- #endif
-
- // No copying
- FW_CFixedAllocator(const FW_CFixedAllocator& );
- FW_CFixedAllocator& operator=(const FW_CFixedAllocator& );
- };
-
- #endif // FWFIXMEM_H
-